<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src='<c:url value="/js/boot.js"></c:url>'></script>
<link rel="stylesheet" type="text/css"
	href='<c:url value="/share/styles.css"></c:url>' />

<script type="text/javascript"
	src='<c:url value="/js/swfupload/swfupload.js"></c:url>'></script>
<%-- <script type="text/javascript"
	src='<c:url value="/js/swfuploadJs.js"></c:url>'></script>
<script type="text/javascript"
	src='<c:url value="/js/swfupload/plugins/swfupload.queue.js"></c:url>'></script> --%>
<script type="text/javascript"
	src='<c:url value="/js/ajaxfileupload.js"></c:url>'></script>

<link rel="stylesheet" type="text/css"
	href='<c:url value="/share/upload.css"></c:url>' />
</head>

<body>
	<div
		style="font-size: 12px; border-bottom: 1px solid #faebcc; padding: 6px; background-color: #fcf8e3;">
		<b>注意：</b>请将文件大小限制在20Mb以内，文件格式为.doc，.docx，.xls，.xlsx，.jpg，.jpeg，.pdf。<br />如果上传文件停滞，请关闭此窗口，重新打开后上传！
	</div>
	<div id="errorPan"></div>

<p><input type="file" id="file1" name="file" /></p>
    <input type="button" value="上传" onclick="ajaxFileUpload"/>
    <p><img id="img1" alt="上传成功啦" src="" /></p>

	<!-- <form name="UploadForm" enctype="multipart/form-data" method="post"
		action="http://192.168.5.200:8080/lawyerPlatform/file/upload/110">
		用户名：<input type="text" id="userName" name="userName" /><br> 
		密码：<input
			type="password" id="password" name="password" /><br> 
			<input
				type="file" name="File1" size="20" maxlength="20"><br>
			<input type="file" name="File2" size="20" maxlength="20"><br>
			<input type="submit" value="上传">
	</form> -->

	<%-- <input type="hidden" id="contextPath" value='${rootpath}/' />
	<input type="hidden" id="uploadPath"
		value='<c:url value="/attchUpdate/upload/contract?refNo=${refNo}"></c:url>' />
	<div id="swfupload" style="padding: 5px;">
		<span id="spanButtonPlaceholder"></span>
		<p id="queueStatus"></p>
		<ol id="logList"></ol>
	</div> --%>
	<script type="text/javascript">
		mini.parse();
		$(function () {
           /*  $(":button").click(function () {
                ajaxFileUpload();
            }) */
        })
        function ajaxFileUpload() {
            $.ajaxFileUpload
            (
                {
                    url: 'http://192.168.5.200:8080/lawyerPlatform/pages/upload.aspx', //用于文件上传的服务器端请求地址
                    secureuri: false, //是否需要安全协议，一般设置为false
                    fileElementId: 'file1', //文件上传域的ID
                    dataType: 'json', //返回值类型 一般设置为json
                    success: function (data, status)  //服务器成功响应处理函数
                    {
                        $("#img1").attr("src", data.imgurl);
                        if (typeof (data.error) != 'undefined') {
                            if (data.error != '') {
                                alert(data.error);
                            } else {
                                alert(data.msg);
                            }
                        }
                    },
                    error: function (data, status, e)//服务器响应失败处理函数
                    {
                        alert(e);
                    }
                }
            )
            return false;
        }
	</script>
</body>
</html>
